/**
 * @Auther: wangliuyang
 * @Date: 2021/4/22 21:34
 * @Description: 11. 盛最多水的容器
 */
public class Solution_11 {
    public int maxArea(int[] height) {
        int area = 0;
        int left = 0 , right =height.length - 1;
        while (left < right){
            if (height[left] <= height[right]) {
                area = Math.max(area,height[left] * (right - left));
                left++;
            }else {
                    area = Math.max(area,height[right] * (right - left));
                    right--;
            }
        }
        return area;
    }
}
